package day0717;

import java.util.Scanner;

public class Test13 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入年份");
        int year=sc.nextInt();
        System.out.println("请输入月份");
        int month=sc.nextInt();
        while(1<=month  &&  month<=12){
            if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12){
                System.out.println(year+"年"+month+"是31天");
            }else if(month==4 || month==6 || month==9 || month==11){
                System.out.println(year+"年"+month+"是30天");
            }else{
                System.out.println( year%400==0 ||(year%4==0||year%100!=0)?   year+"年"+month+"是28天":   year+"年"+month+"是29天");
            }
            System.out.println("请输入年份");
            year=sc.nextInt();
            System.out.println("请输入月份");
            month=sc.nextInt();
        }
    }
}
